﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MetaCollection.ContentService.Http
{
	/// <summary>
	/// 4xx Client Error
	/// ------------------------------------
	/// The request contains bad syntax or cannot be fulfilled. The 4xx class of status code is intended for cases in which
	/// the client seems to have erred. Except when responding to a HEAD request, the server should include an entity
	/// containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status
	/// codes are applicable to any request method. User agents should display any included entity to the user.	/// </summary>
	public enum ClientErrorStatus
	{
		None = 0,
		/// <summary>
		/// The request contains bad syntax or cannot be fulfilled.
		/// </summary>
		BadRequest = 400,
		/// <summary>
		/// Similar to 403 Forbidden, but specifically for use when authentication is possible but has failed or not yet been
		/// provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the
		/// requested resource. See Basic access authentication and Digest access authentication.
		/// </summary>
		Unauthorized = 401,
		/// <summary>
		/// The original intention was that this code might be used as part of some form of digital cash or micropayment scheme,
		/// but that has not happened, and this code has never been used.
		/// </summary>
		PaymentRequired = 402,
		/// <summary>
		/// The request was a legal request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response,
		/// authenticating will make no difference.
		/// </summary>
		Forbidden = 403,
		/// <summary>
		/// The requested resource could not be found but may be available again in the future. Subsequent requests by the client
		/// are permissible.
		/// </summary>
		NotFound = 404,
		/// <summary>
		/// A request was made of a resource using a request method not supported by that resource; for example, using GET on a 
		/// form which requires data to be presented via POST, or using PUT on a read-only resource.
		/// </summary>
		MethodNotAllowed = 405,
		/// <summary>
		/// The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.
		/// </summary>
		NotAcceptable = 406,
		ProxyAuthenticationRequired = 407,
		/// <summary>
		/// The server timed out waiting for the request.
		/// </summary>
		RequestTimeout = 408,
		/// <summary>
		/// Indicates that the request could not be processed because of conflict in the request, such as an edit conflict.
		/// </summary>
		Conflict = 409,
		/// <summary>
		/// Indicates that the resource requested is no longer available and will not be available again. This should be used
		/// when a resource has been intentionally removed; however, it is not necessary to return this code and a 404 Not Found
		/// can be issued instead. Upon receiving a 410 status code, the client should not request the resource again in the future.
		/// Clients such as search engines should remove the resource from their indexes.
		/// </summary>
		Gone = 410,
		/// <summary>
		/// The request did not specify the length of its content, which is required by the requested resource.
		/// </summary>
		LengthRequired = 411,
		/// <summary>
		/// The server does not meet one of the preconditions that the requester put on the request.
		/// </summary>
		PreconditionFailed = 412,
		/// <summary>
		/// The request is larger than the server is willing or able to process.
		/// </summary>
		RequestEntityTooLarge = 413,
		/// <summary>
		/// The URI provided was too long for the server to process.
		/// </summary>
		RequestUriTooLong = 414,
		/// <summary>
		/// The request did not specify any media types that the server or resource supports. For example the client specified
		/// that an image resource should be served as image/svg+xml, but the server cannot find a matching version of the image.
		/// </summary>
		UnsupportedMediaType = 415,
		/// <summary>
		/// The client has asked for a portion of the file, but the server cannot supply that portion (for example, if the client
		/// asked for a part of the file that lies beyond the end of the file).
		/// </summary>
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Satisfiable")]
		RequestedRangeNotSatisfiable = 416,
		/// <summary>
		/// The server cannot meet the requirements of the Expect request-header field.
		/// </summary>
		ExpectationFailed = 417,
		/// <summary>
		/// The HTCPCP server is a teapot. The responding entity MAY be short and stout. Defined by the April Fools' specification
		/// RFC 2324. See Hyper Text Coffee Pot Control Protocol for more information.
		/// </summary>
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ima")]
		ImaTeapot = 418,
		/// <summary>
		/// The request was well-formed but was unable to be followed due to semantic errors. (WebDAV) (RFC 4918 )
		/// </summary>
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unprocessable")]
		UnprocessableEntity = 422,
		/// <summary>
		/// The resource that is being accessed is locked (WebDAV) (RFC 4918 )
		/// </summary>
		Locked = 423,
		/// <summary>
		/// The request failed due to failure of a previous request (e.g. a PROPPATCH).  (WebDAV) (RFC 4918 )
		/// </summary>
		FailedDependency = 424,
		/// <summary>
		/// Defined in drafts of WebDav Advanced Collections, but not present in "Web Distributed Authoring and
		/// Versioning (WebDAV) Ordered Collections Protocol" (RFC 3648).
		/// </summary>
		UnorderedCollection = 425,
		/// <summary>
		/// The client should switch to TLS/1.0. (RFC 2817)
		/// </summary>
		UpgradeRequired = 426,
		/// <summary>
		/// A Microsoft extension. The request should be retried after doing the appropriate action.
		/// </summary>
		RetryWith = 449
	}
}
